/*! \file HXMorph.h
    \brief Head X animation morphs.

	Head X | Flinders University | Martin Luerssen & Trent Lewis | 2009+
*/

#pragma once

#include "HXUtil.h"
#include "HXModel.h"

//-----------------------------------------------------------------------------

//! Internal types of morphs.
enum HXMorphType
{
	HXMT_NONE = 0x0000,
	HXMT_DIFF = 0x0001,
	HXMT_STAT = 0x0002,
	HXMT_ANY = 0xFFFF
};

//-----------------------------------------------------------------------------

//! Morph label to index mapping.
struct HXMorphIndex
{
	HXMorphIndex() : index(0), source(HXMT_NONE) {}
	HXMorphIndex(size_t a_index, HXMorphType a_source) : index(a_index), source(a_source) {}
	void Set(size_t a_index, HXMorphType a_source) { index = a_index; source = a_source; }

	size_t index;
	HXMorphType source;
};

//-----------------------------------------------------------------------------

//! Morph data.
struct HXMorph
{
	HXMorph();
	void CreateFrom(HXModel& model);
	void Reset();
	float& operator[](const wstring& label);

	size_t				morphAdjustableCount;
	vector<float>		diffMorphVals;
	vector<float>		statMorphVals;
	map<wstring, HXMorphIndex>	morphMap;
	float				dummyVal;
};

//-----------------------------------------------------------------------------